﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;

using RFSession = com.vs.General.Session;

namespace com.vs.General.RF
{
    public abstract class RFPage : System.Web.UI.Page
    {
        protected RFSession rfSess = null;
        protected string stErrorMessage = null; //从上一个页面传递来的处理错误消息
        protected string stError = null;//当前页面处理过程中的错误消息
        protected string stSourcePage = null;
        protected string stTargetPage = null;

        public RFPage()
        {
            //System.Web.SessionState.HttpSessionState curSess = HttpContext.Current.Session;
            //this.rfSess = (RFSession)curSess[RFSupport.SESSION];
            this.Load += new EventHandler(verifyLogin); 
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this.rfSess = (RFSession)Session[RFSupport.SESSION];
        }

        protected abstract void parseRequest();

        protected abstract void initData();

        protected void verifyLogin(object sender, EventArgs e)
        {
            if (Session[RFSupport.SESSION] == null)
            {
                Response.Redirect("~/login/Login.aspx?ERROR_MESSAGE=错误：请登录");
            }
        }
    }
}
